<?php
class Parser_Html_Clipvn extends Parser_Html {
    
    
    public function content()
    {
        $video = $this->_meta('og:video');
		if ( ! $video) {
			$video = $this->_url;
			$pos = strrpos($video, ',');
			$id = substr($video, $pos);
        } else {
			$id = str_replace(array('http://clip.vn/w/', ',f'), '', $video);
		}
		
		return "http://clip.vn/embed/" . $id;
    }
    
    
    public function author()
    {
        $author = $this->select('#watch-uploader-info > a');
        return isset($author[0]) ? Arr::get($author[0], 'text') : null;
    }
    
    
}